//Truck.h
#ifndef TRUCK_H_
#define TRUCK_H_
#include "Vehicle.h"
#include <string>
using namespace std;
class Truck : public Vehicle {
private:
    double payload;
public:
    static string use;

    Truck(int wh = 0, double we = 0, int pl = 0) : Vehicle(wh, we), payload(pl) {}

    Truck(const Truck& truck) {
        this->setWeight(truck.weight);
        this->setWheels(truck.wheels);
        payload = truck.payload;
    }

    ~Truck() {}

    void Display() override {
        cout << "这是一辆货车，有"
            << getWheels() << "个轮子，自重"
            << getWeight() << "吨，载重不超过"
            << payload << "吨。" << endl;
    }

    void setPayload(double payload) {
        this->payload = payload;
    }

    double getPayload() {
        return this->payload;
    }
};
string Truck::use = "货物运输";
#endif